home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Linux Cubed Series 7: Sunsite
/
Linux Cubed Series 7 - Sunsite Vol 1.iso
/
system
/
admin
/
accounts
/
shadow-3.001
/
shadow-3.3.1-2.dif
Wrap
Text File
|
1994-04-17
|
58KB
|
2,071 lines
--- Makefile
+++ Makefile 1994/04/17 18:01:42
@@ -31,14 +31,14 @@
# seems to use /bin, USG seems to use /etc, SunOS 4.1.1 seems to use /usr/bin.
# If you define SCOLOGIN, you MUST use /etc as LOGINDIR.
# LOGINDIR = /bin
-LOGINDIR = /etc
+LOGINDIR = /bin
# LOGINDIR = /usr/bin
# Define any special libraries required to access the directory routines.
# Some systems require -lndir for the directory routines. SCO Xenix uses
# -lx for that. Your system might need nothing.
# NDIR = -lndir
-NDIR = -lx
+NDIR =
# NDIR =
# Define some stuff for Cracklib. This assumes that libcracklib.a is
@@ -47,7 +47,7 @@
# CRACKLIB=-lcrack
# Pick your favorite C compiler and tags command
-CC = cc
+CC = gcc
TAGS = ctags
# OS. Pick one of USG (AT&T, SYSV, SYS3), BSD, SUN (SunOS 2 and 3),
@@ -80,10 +80,9 @@
DEST_INCLUDE_DIR = /usr/include
# Flags for SCO Xenix/386
-CFLAGS = -O -M3 -g $(OS) -I$(DEST_INCLUDE_DIR) $(CRACKDEF)
-LIBS = -lcrypt -lndbm
-# LIBS = -lcrypt -ldbm
-LDFLAGS = -M3 -g
+CFLAGS = -O2 -m486 -fomit-frame-pointer $(OS)
+LIBS =
+LDFLAGS = -s -v
LTFLAGS =
# Flags for normal machines
@@ -96,24 +95,6 @@
# LIBS =
# LDFLAGS =
-# This should be Slibsec.a for small model, or Llibsec.a for
-# large model or whatever. MUST AGREE WITH CFLAGS!!! For non-Intel
-# machines, just use libsec.a
-LIBSEC = Slibsec.a
-# LIBSEC = libsec.a
-
-# Names for root user and group, and bin user and group. See your
-# /etc/passwd and /etc/group files. BSD and SUN use "wheel", most
-# others use "root" for RGID.
-RUID = root
-RGID = root
-# RGID = wheel
-BUID = bin
-BGID = bin
-
-# Where the login.defs file will be copied. Must agree with config.h
-DEST_LOGIN_DEFS = /etc/login.defs
-
# Rules for .L (lint) files.
.SUFFIXES: .L
LINT = lint
@@ -186,9 +167,9 @@
spdbm.c dpmain.c gshadow.c gsdbm.c gspack.c sgroupio.c useradd.c \
userdel.c patchlevel.h usermod.c copydir.c mkrmdir.c groupadd.c \
groupdel.c groupmod.c tz.c console.c hushed.c getdef.c scologin.c \
- logoutd.c groups.c pwauth.c lockpw.c chowndir.c
+ logoutd.c groups.c pwauth.c pwloginstr.c lockpw.c chowndir.c
-FILES1 = README patchlevel.h newgrp.c Makefile config.h pwunconv.c obscure.c \
+FILES1 = README patchlevel.h newgrp.c config.h pwunconv.c obscure.c \
age.c id.c
FILES2 = passwd.c port.c lmain.c sulogin.c pwpack.c dialup.c
@@ -201,11 +182,11 @@
pwdbm.c grdbm.c gshadow.c sppack.c grpck.c
FILES6 = gspack.c spdbm.c lastlog.h shell.c login.c sub.c dpmain.c mail.c \
- env.c pwd.h.m4 grpack.c shadow.h log.c grent.c motd.c dialup.h \
+ env.c pwd.h.m4 grpack.c log.c grent.c motd.c dialup.h \
fields.c gsdbm.c utmp.c failure.c
FILES7 = groupio.c shadowio.c sgroupio.c groups.c copydir.c mkrmdir.c \
- mkpasswd.c pwauth.c pwauth.h lastlog.c
+ mkpasswd.c pwauth.c pwauth.h pwloginstr.c lastlog.c
FILES8 = useradd.c usermod.c login.defs
@@ -218,23 +199,28 @@
MAN_1 = chage.1 chfn.1 chsh.1 id.1 login.1 newgrp.1 passwd.1 su.1 \
useradd.1 userdel.1 usermod.1 groupadd.1 groupdel.1 groupmod.1 \
groups.1 pwck.1 grpck.1
-MAN_3 = shadow.3 pwauth.3
+MAN_3 = shadow.3
MAN_4 = faillog.4 passwd.4 porttime.4 shadow.4
MAN_5 = login.5
-MAN_8 = chpasswd.8 dpasswd.8 faillog.8 newusers.8 pwconv.8 pwunconv.8 \
- sulogin.8 mkpasswd.8 logoutd.8 pwauth.8 lastlog.8
+MAN_8 = dpasswd.8 faillog.8 newusers.8 lastlog.8
DOCS1 = $(MAN_1) $(MAN_3) $(MAN_4)
DOCS2 = $(MAN_5) $(MAN_8)
DOCS = $(DOCS1) $(DOCS2)
-BINS = su login pwconv pwunconv passwd sulogin faillog newgrp sg gpasswd \
- mkpasswd chfn chsh chage chpasswd newusers dpasswd id useradd \
- userdel usermod groupadd groupdel groupmod $(SCOLOGIN) logoutd \
+BINS = su login passwd faillog newgrp sg gpasswd \
+ chfn chsh chage newusers dpasswd id useradd \
+ userdel usermod groupadd groupdel groupmod $(SCOLOGIN) \
groups pwck grpck lastlog
all: $(BINS) $(DOCS)
+Linux:
+ rm -f shadow.h
+ touch Linux
+
+$(BINS): Linux
+
.PRECIOUS: libshadow.a
libshadow.a: \
@@ -257,81 +243,35 @@
libshadow.a(pwio.o) \
libshadow.a(pwpack.o) \
libshadow.a(pwauth.o) \
+ libshadow.a(pwloginstr.o) \
libshadow.a(rad64.o) \
libshadow.a(spdbm.o) \
libshadow.a(shadow.o) \
libshadow.a(shadowio.o) \
libshadow.a(sppack.o) \
+ libshadow.a(sppwd.o) \
libshadow.a(lockpw.o)
$(RANLIB) libshadow.a
-libsec: $(LIBSEC)(shadow.o)
- $(RANLIB) $(LIBSEC)
+sppwd.o: sppwd.c
-save:
- [ ! -d save ] && mkdir save
- -cp $(LOGINDIR)/login save
- -cp /etc/mkpasswd /etc/pwconv /etc/pwunconv /etc/sulogin /etc/chpasswd \
- /etc/newusers /etc/useradd /etc/userdel /etc/usermod \
- /etc/groupadd /etc/groupdel /etc/groupmod /etc/logoutd \
- /etc/login.defs /etc/pwck /etc/grpck save
- -cp /bin/su /bin/passwd /bin/gpasswd /bin/dpasswd /bin/faillog \
- /bin/newgrp /bin/chfn /bin/chsh /bin/chage /bin/id \
- /bin/scologin save
- -cp $(DEST_INCLUDE_DIR)/dialup.h $(DEST_INCLUDE_DIR)/shadow.h \
- $(DEST_INCLUDE_DIR)/pwd.h save
-
-restore:
- [ -d save ]
- -(cd save ; cp login $(LOGINDIR) )
- -(cd save ; -cp mkpasswd pwconv pwunconv sulogin chpasswd \
- newusers useradd userdel usermod groupadd groupdel groupmod \
- logoutd login.defs pwck grpck /etc)
- -(cd save ; cp su passwd gpasswd dpasswd faillog newgrp chfn chsh \
- chage id scologin /bin)
- -(cd save ; cp dialup.h shadow.h pwd.h $(DEST_INCLUDE_DIR) )
install: all
- strip $(BINS)
- cp login $(LOGINDIR)/login
- cp mkpasswd pwconv pwunconv sulogin chpasswd newusers \
- useradd userdel usermod groupadd groupdel groupmod logoutd \
- pwck grpck /etc
- cp su passwd gpasswd dpasswd faillog newgrp chfn chsh chage id /bin
- rm -f /bin/sg
- ln /bin/newgrp /bin/sg
- cp dialup.h shadow.h pwd.h $(DEST_INCLUDE_DIR)
- chown $(RUID) $(LOGINDIR)/login /etc/pwconv /etc/pwunconv /etc/sulogin \
- /bin/su /bin/passwd /bin/gpasswd /bin/newgrp /etc/mkpasswd \
- /bin/dpasswd /bin/chsh /bin/chfn /bin/chage /etc/useradd \
- /etc/userdel /etc/usermod /etc/groupadd /etc/groupdel \
- /etc/groupmod /etc/logoutd /etc/pwck /etc/grpck
- chgrp $(RGID) $(LOGINDIR)/login /etc/pwconv /etc/pwunconv /etc/sulogin \
- /bin/su /bin/passwd /bin/gpasswd /bin/newgrp /etc/mkpasswd \
- /bin/dpasswd /bin/chsh /bin/chfn /bin/chage /etc/useradd \
- /etc/userdel /etc/usermod /etc/groupadd /etc/groupdel \
- /etc/groupmod /etc/logoutd /etc/pwck /etc/grpck
- chown $(BUID) /bin/faillog /bin/id $(DEST_INCLUDE_DIR)/shadow.h \
- $(DEST_INCLUDE_DIR)/dialup.h $(DEST_INCLUDE_DIR)/pwd.h
- chgrp $(BGID) /bin/faillog /bin/id $(DEST_INCLUDE_DIR)/shadow.h \
- $(DEST_INCLUDE_DIR)/dialup.h $(DEST_INCLUDE_DIR)/pwd.h
- chmod 700 /etc/pwconv /etc/pwunconv /etc/sulogin /etc/mkpasswd \
- /etc/chpasswd /etc/newusers /bin/dpasswd /etc/logoutd \
- /etc/useradd /etc/userdel /etc/usermod /etc/groupadd \
- /etc/groupdel /etc/groupmod /etc/pwck /etc/grpck
- chmod 4711 $(LOGINDIR)/login /bin/su /bin/passwd /bin/gpasswd \
- /bin/newgrp /bin/chfn /bin/chsh /bin/chage
- chmod 711 /bin/faillog /bin/id
- chmod 444 $(DEST_INCLUDE_DIR)/shadow.h $(DEST_INCLUDE_DIR)/dialup.h \
- $(DEST_INCLUDE_DIR)/pwd.h
- [ -f $(DEST_LOGIN_DEFS) ] || (cp login.defs $(DEST_LOGIN_DEFS) ; \
- chown $(RUID) $(DEST_LOGIN_DEFS) ; \
- chgrp $(RGID) $(DEST_LOGIN_DEFS) ; \
- chmod 600 $(DEST_LOGIN_DEFS) )
- [ -z "$(SCOLOGIN)" ] || (cp scologin /bin/login ; \
- chown $(RUID) /bin/login ; \
- chgrp $(RGID) /bin/login ; \
- chmod 755 /bin/login )
+ install -m 644 $(MAN_1) /usr/man/man1
+ install -m 644 $(MAN_3) /usr/man/man3
+ install -m 644 $(MAN_4) /usr/man/man4
+ install -m 644 $(MAN_5) /usr/man/man5
+ install -m 644 $(MAN_8) /usr/man/man8
+ install groups /usr/bin
+ install -m4755 chfn chsh chage /usr/bin
+ install -m4755 login $(LOGINDIR)/login
+ install -m744 newusers \
+ useradd userdel usermod groupadd groupdel groupmod \
+ faillog lastlog pwck grpck /usr/sbin
+ install -m755 dpasswd id /bin
+ install -m4755 su passwd gpasswd newgrp /bin
+ ln -sf newgrp /bin/sg
+ install -m644 libshadow.a /usr/lib
lint: su.lint login.lint pwconv.lint pwunconv.lint passwd.lint sulogin.lint \
faillog.lint newgrp.lint gpasswd.lint mkpasswd.lint chfn.lint \
@@ -531,8 +471,8 @@
pwd.h.m4:
[ -f s.pwd.h.m4 ] && $(GET) $(GFLAGS) s.pwd.h.m4
-pwd.h: pwd.h.m4
- m4 $(OS) < pwd.h.m4 > pwd.h
+#pwd.h: pwd.h.m4
+# m4 $(OS) < pwd.h.m4 > pwd.h
logoutd: logoutd.o libshadow.a
$(CC) -o logoutd $(LDFLAGS) logoutd.o libshadow.a
@@ -557,70 +497,70 @@
susetup.c: setup.c
cp setup.c susetup.c
-susetup.o: config.h susetup.c pwd.h
+susetup.o: config.h susetup.c
$(CC) -c $(CFLAGS) -DSU susetup.c
scologin: scologin.o
$(CC) -o scologin $(LDFLAGS) scologin.o -lsocket
-passwd.o: config.h shadow.h pwd.h pwauth.h
-lmain.o: config.h lastlog.h faillog.h pwd.h pwauth.h
-smain.o: config.h lastlog.h pwd.h shadow.h pwauth.h
-sub.o: pwd.h
-setup.o: config.h pwd.h
+passwd.o: config.h pwauth.h
+lmain.o: config.h lastlog.h faillog.h pwauth.h
+smain.o: config.h lastlog.h pwauth.h
+sub.o:
+setup.o: config.h
mkrmdir.o: config.h
utmp.o: config.h
mail.o: config.h
motd.o: config.h
-age.o: config.h pwd.h
-log.o: config.h lastlog.h pwd.h
+age.o: config.h
+log.o: config.h lastlog.h
shell.o: config.h
-entry.o: config.h shadow.h pwd.h
-hushed.o: config.h pwd.h
-valid.o: config.h pwd.h
+entry.o: config.h
+hushed.o: config.h
+valid.o: config.h
failure.o: faillog.h config.h
-faillog.o: faillog.h config.h pwd.h
-newgrp.o: config.h shadow.h pwd.h
-mkpasswd.o: config.h shadow.h pwd.h
-gpmain.o: config.h pwd.h
-chfn.o: config.h pwd.h
-chsh.o: config.h pwd.h
-chage.o: config.h shadow.h pwd.h
-pwconv.o: config.h shadow.h
-pwunconv.o: config.h shadow.h pwd.h
-chpasswd.o: config.h shadow.h pwd.h
-id.o: pwd.h
-newusers.o: config.h shadow.h pwd.h
+faillog.o: faillog.h config.h
+newgrp.o: config.h
+mkpasswd.o: config.h
+gpmain.o: config.h
+chfn.o: config.h
+chsh.o: config.h
+chage.o: config.h
+pwconv.o: config.h
+pwunconv.o: config.h
+chpasswd.o: config.h
+id.o:
+newusers.o: config.h
dpmain.o: config.h dialup.h
-useradd.o: config.h shadow.h pwd.h pwauth.h
-userdel.o: config.h shadow.h pwd.h pwauth.h
-usermod.o: config.h shadow.h pwd.h pwauth.h
-groupadd.o: config.h shadow.h
-groupdel.o: config.h shadow.h
-groupmod.o: config.h shadow.h
+useradd.o: config.h pwauth.h
+userdel.o: config.h pwauth.h
+usermod.o: config.h pwauth.h
+groupadd.o: config.h
+groupdel.o: config.h
+groupmod.o: config.h
logoutd.o: config.h
sulogin.o: config.h pwauth.h
copydir.o: config.h
chowndir.o: config.h
-pwck.o: config.h shadow.h pwd.h
-grpck.o: config.h shadow.h pwd.h
+pwck.o: config.h
+grpck.o: config.h
-libshadow.a(shadow.o): shadow.h config.h
-libshadow.a(shadowio.o): shadow.h
-libshadow.a(grent.o): config.h shadow.h
-libshadow.a(sgroupio.o): shadow.h
+libshadow.a(shadow.o): config.h
+libshadow.a(shadowio.o):
+libshadow.a(grent.o): config.h
+libshadow.a(sgroupio.o):
libshadow.a(dialup.o): dialup.h
libshadow.a(dialchk.o): dialup.h config.h
libshadow.a(getdef.o): config.h
-libshadow.a(pwdbm.o): config.h pwd.h
-libshadow.a(spdbm.o): config.h shadow.h
+libshadow.a(pwdbm.o): config.h
+libshadow.a(spdbm.o): config.h
libshadow.a(grdbm.o): config.h
libshadow.a(gshadow.o): config.h
-libshadow.a(gsdbm.o): config.h shadow.h
+libshadow.a(gsdbm.o): config.h
libshadow.a(pwauth.o): config.h pwauth.h
-libshadow.a(pwpack.o): config.h pwd.h
-libshadow.a(pwent.o): config.h pwd.h
-libshadow.a(pwio.o): pwd.h
+libshadow.a(pwpack.o): config.h
+libshadow.a(pwent.o): config.h
+libshadow.a(pwio.o):
libshadow.a(getpass.o): config.h
libshadow.a(encrypt.o): config.h
libshadow.a(port.o): port.h
@@ -628,10 +568,10 @@
libshadow.a(lockpw.o):
clean:
- -rm -f susetup.c *.o a.out core npasswd nshadow *.pag *.dir pwd.h
+ -rm -f susetup.c *.o a.out core npasswd nshadow *.pag *.dir
clobber: clean
- -rm -f $(BINS) *.lint *.L libshadow.a
+ -rm -f $(BINS) *.lint *.L libshadow.a Linux
nuke: clobber
-for file in * ; do \
--- README.linux
+++ README.linux 1994/04/17 18:07:14
@@ -0,0 +1,39 @@
+
+I have uploaded a new version of Linux-specific patches for shadow-3.3.1
+into the Incoming directory of sunsite.unc.edu.
+
+File name: shadow-3.3.1-2.dif
+
+I have put together patches from the following people:
+- Riku Meskanen, <mesrik@tukki.jyu.fi>
+- Mohan Kokal, <magnus@cegt201.bradley.edu>
+
+Partial list of the enhancements and bug fixes:
+- add new variable LOGIN_STRING to /etc/login.defs which
+ allows administrator control "Password :" string.
+- removed the problem when login trashing TERM= variable on
+ normal login even when -p is *not* defined.
+- The shadow library is also installed.
+- The "lastlog" file now also updates the hostname of the last login.
+- "su" makes better syslog-messages.
+- "lastlog" now works.
+
+To install this package do a "make". If everything compiles, do a
+"make install" as root. Do not forget to update your "/etc/login.defs"!
+Otherwise, your "login" won't work!!!
+
+More detailed: You have to fetch the original source code of the
+shadow 3.3.1 package. (It is on sunsite, "shadow-3.3.1.tar.gz")
+Unpack that source package with "tar xzf shadow-3.3.1.tar.gz" and go into
+the source directory ("cd shadow-3.3.1"). Then you have to apply the Linux
+patches with "patch -s -p0 < shadow-3.3.1-2.dif". Then "make; make install".
+
+Please send me any further bug fixes for the next release.
+
+
+Florian La Roche, flla@stud.uni-sb.de
+
+P.S.: I do *not* know, when the next official release of the shadow-system
+ will be...
+
+
--- chage.1
+++ chage.1 1994/04/17 17:59:13
@@ -8,7 +8,7 @@
.\"
.TH CHAGE 1
.SH NAME
-chage \- change user password expirate information
+chage \- change user password expire information
.SH SYNOPSIS
\fBchage\fR [ \fB-m \fImindays\fR ] [ \fB-M \fImaxdays\fR ]
[ \fB-d \fIlastday\fR ] [ \fB-I \fIinactive\fR ]
@@ -16,20 +16,20 @@
.sp 1
\fBchage\fR -l \fIuser\fR
.SH DESCRIPTION
-\fIchage\f changes the number of days between password changes and the
+\fIchage\fR changes the number of days between password changes and the
date of the last password change.
This information is used by the system to determine when a user must
change her password.
-The \fIchage\f command is restricted to the root user, except for the
+The \fIchage\fR command is restricted to the root user, except for the
\fB-l\fR option, which may be used by an unprivileged user to determine
when her password or account is due to expire.
.PP
-With the \fB-m\fR option, the value of \fImindays\f is the minimum number
+With the \fB-m\fR option, the value of \fImindays\fR is the minimum number
of days between password changes.
A value of zero for this field indicates that the user may change
her password at any time.
.PP
-With the \fB-M\fR option, the value of \fImaxdays\f is the maximum number
+With the \fB-M\fR option, the value of \fImaxdays\fR is the maximum number
of days during which a password is valid.
When \fImaxdays\fR plus \fIlastday\fR is less than the current day,
the user will be required to change her password before being
@@ -37,7 +37,7 @@
This occurance can be planned for in advance by use of the \fB-W\fR option,
which provides the user with advance warning.
.PP
-With the \fB-d\fR option, the value of \fIlastday\f is the number of days
+With the \fB-d\fR option, the value of \fIlastday\fR is the number of days
since January 1st, 1970 when the password was last changed.
The date may also be expressed in the format MM/DD/YY (or the format more
commonly used in your area).
@@ -63,16 +63,11 @@
The \fIwarndays\fR option is the number of days prior to the password
expiring that a user will be warned her password is about to expire.
.PP
-All of the above values are stored exactly as days when the shadow
-password file is used, but are converted to and from weeks when the
-standard password file is used.
-Because of this conversion, rounding errors may result.
-.PP
-If none of the options are selected, \fIchage\f operates in an interactive
+If none of the options are selected, \fIchage\fR operates in an interactive
fashion, prompting the user with the current values for all of the fields.
Enter the new value to change the field, or leave the line blank to use
the current value.
-The current value is displayed between a pair of \fB[ ]\f marks.
+The current value is displayed between a pair of \fB[ ]\fR marks.
.SH Files
/etc/passwd \- user account information
.br
--- chfn.1
+++ chfn.1 1994/04/17 17:59:13
@@ -15,25 +15,25 @@
[ \fB-w \fIwork_ph\fR ] [ \fB-h \fIhome_ph\fR ] [ \fB-o \fIother\fR ]
[ \fIuser\fR ]
.SH DESCRIPTION
-\fIchfn\f changes user fullname, office number, office extension, and home
+\fIchfn\fR changes user fullname, office number, office extension, and home
phone number information for a user's account.
-This information is typically printed by \fIfinger(1)\f and similiar
+This information is typically printed by \fIfinger(1)\fR and similiar
programs.
A normal user may only change the fields for their own account,
the super user may change the fields for any account.
-Also, only the super user may use the \fB-o\f option to change the
+Also, only the super user may use the \fB-o\fR option to change the
undefined portions of the GCOS field.
.PP
The only restrictions placed on the contents of the fields is that no
control characters may be present, nor any of comma, colon, or equal sign.
-The \fIother\f field does not have this restriction, and is used to
+The \fIother\fR field does not have this restriction, and is used to
store accounting information used by other applications.
.PP
-If none of the options are selected, \fIchfn\f operates in an interactive
+If none of the options are selected, \fIchfn\fR operates in an interactive
fashion, prompting the user with the current values for all of the fields.
Enter the new value to change the field, or leave the line blank to use
the current value.
-The current value is displayed between a pair of \fB[ ]\f marks.
+The current value is displayed between a pair of \fB[ ]\fR marks.
Without options, chfn prompts for the current user account.
.SH Files
/etc/passwd \- user account information
--- config.h
+++ config.h 1994/04/17 17:59:13
@@ -12,6 +12,9 @@
* no warrantee of any kind.
*/
+#include <sys/types.h>
+#include <stdio.h>
+
/*
* Configuration file for login.
*
@@ -19,6 +22,8 @@
*/
+#define LASTFILE "/var/adm/lastlog"
+
/*
* Pathname to the run-time configuration definitions file.
*/
@@ -53,7 +58,7 @@
* Define DOUBLESIZE to use 16 character passwords
*/
-#define DOUBLESIZE
+#undef DOUBLESIZE
/*
* Define AGING if you want the password aging checks made.
@@ -82,7 +87,7 @@
*/
#define RLOGIN
-#undef UT_HOST
+#define UT_HOST
/*
* Define the "success" code from ruserok(). Most modern systems use 0
@@ -96,9 +101,9 @@
* Select one of the following
*/
-#define DIR_XENIX /* include <sys/ndir.h>, use (struct direct) */
+/* #define DIR_XENIX /* include <sys/ndir.h>, use (struct direct) */
/* #define DIR_BSD /* include <ndir.h>, use (struct direct) */
-/* #define DIR_SYSV /* include <dirent.h>, use (struct dirent) */
+#define DIR_SYSV /* include <dirent.h>, use (struct dirent) */
/*
* Various system environment definitions.
@@ -106,23 +111,23 @@
#define HAVE_ULIMIT /* Define if your UNIX supports ulimit() */
#undef HAVE_RLIMIT /* Define if your UNIX supports setrlimit() */
-#define GETPWENT /* Define if you want my GETPWENT(3) routines */
-#define GETGRENT /* Define if you want my GETGRENT(3) routines */
+#undef GETPWENT /* Define if you want my GETPWENT(3) routines */
+#undef GETGRENT /* Define if you want my GETGRENT(3) routines */
#define NEED_AL64 /* Define if library does not include a64l() */
-#define NEED_MKDIR /* Define if system does not have mkdir() */
-#define NEED_RMDIR /* Define if system does not have rmdir() */
-#define NEED_RENAME /* Define if system does not have rename() */
-#define NEED_STRSTR /* Define if library does not include strstr() */
+#undef NEED_MKDIR /* Define if system does not have mkdir() */
+#undef NEED_RMDIR /* Define if system does not have rmdir() */
+#undef NEED_RENAME /* Define if system does not have rename() */
+#undef NEED_STRSTR /* Define if library does not include strstr() */
#undef NEED_PUTPWENT /* Define if library does not include putpwent()*/
-#define SIGTYPE int /* Type returned by signal() */
+#define SIGTYPE void /* Type returned by signal() */
/*
* These definitions MUST agree with the values defined in <pwd.h>.
*/
#undef BSD_QUOTA /* the pw_quota field exists */
-#define ATT_AGE /* the pw_age field exists */
-#define ATT_COMMENT /* the pw_comment field exists */
+#undef ATT_AGE /* the pw_age field exists */
+#undef ATT_COMMENT /* the pw_comment field exists */
#define UID_T uid_t /* set to be the type of UID's */
#define GID_T gid_t /* set to be the type of GID's */
@@ -182,7 +187,7 @@
* from single user to multi-user mode.
*/
-#define TELINIT /**/
+#define TELINIT "/sbin/telinit"
#define RUNLEVEL "2" /**/
/*
@@ -190,5 +195,6 @@
* HAS_CRONTAB. If your system can "atrm <user>", define HAS_ATRM.
*/
-#undef HAS_CRONTAB
-#undef HAS_ATRM
+#define CRONTAB_REM "crontab -d -u %s"
+#define ATRUN_REM "atrm %s"
+
--- copydir.c
+++ copydir.c 1994/04/17 17:59:13
@@ -213,8 +213,8 @@
*/
mkdir (dst_name, sb.st_mode & 0777);
- chown (dst_name, uid == -1 ? sb.st_uid:uid,
- gid == -1 ? sb.st_gid:gid);
+ chown (dst_name, uid == (UID_T)-1 ? sb.st_uid:uid,
+ gid == (GID_T)-1 ? sb.st_gid:gid);
if (copy_tree (src_name, dst_name, uid, gid)) {
err++;
@@ -250,8 +250,8 @@
if (! S_ISREG (sb.st_mode)) {
if (mknod (dst_name, sb.st_mode & ~07777, sb.st_rdev) ||
- chown (dst_name, uid == -1 ? sb.st_uid:uid,
- gid == -1 ? sb.st_gid:gid) ||
+ chown (dst_name, uid == (UID_T)-1 ? sb.st_uid:uid,
+ gid == (GID_T)-1 ? sb.st_gid:gid) ||
chmod (dst_name, sb.st_mode & 07777)) {
err++;
break;
@@ -269,8 +269,8 @@
break;
}
if ((ofd = open (dst_name, O_WRONLY|O_CREAT, 0)) < 0 ||
- chown (dst_name, uid == -1 ? sb.st_uid:uid,
- gid == -1 ? sb.st_gid:gid) ||
+ chown (dst_name, uid == (UID_T)-1 ? sb.st_uid:uid,
+ gid == (GID_T)-1 ? sb.st_gid:gid) ||
chmod (dst_name, sb.st_mode & 07777)) {
close (ifd);
err++;
--- faillog.4
+++ faillog.4 1994/04/17 17:59:13
@@ -31,6 +31,6 @@
.DE
.SH Files
-/usr/adm/faillog \- login failure log
+/var/adm/faillog \- login failure log
.SH See Also
faillog(8)
--- faillog.8
+++ faillog.8 1994/04/17 17:59:13
@@ -13,7 +13,7 @@
/etc/faillog [ -u uid ] [ -a ] [ -t days ] [ -m max ] [ -pr ]
.SH DESCRIPTION
\fIfaillog\fR formats the contents of the failure log,
-\fI/usr/adm/faillog\fR, and maintains failure counts and
+\fI/var/adm/faillog\fR, and maintains failure counts and
limits.
The order of the arguments to \fIfaillog\fR is significant.
Each argument is processed immediately in the order given.
@@ -31,14 +31,14 @@
It is meaningless with the \fB-r\fR flag.
.PP
The \fB-r\fR flag is used to reset the count of login failures.
-Write access to \fI/usr/adm/faillog\fR is required for
+Write access to \fI/var/adm/faillog\fR is required for
this option.
Entering \fB-u login-name\fR will cause only the failure count
for \fBlogin-name\fR to be reset.
.PP
The \fB-m\fR flag is used to set the maximum number of login
failures before the account is disabled.
-Write access to \fB/usr/adm/faillog\fR is required for this
+Write access to \fB/var/adm/faillog\fR is required for this
option.
Entering \fB-m max\fR will cause all accounts to be disabled
after \fBmax\fR failed logins occur.
@@ -60,7 +60,7 @@
failure, you must explicitly request the user with the \fB-u\fR flag,
or print out all users with the \fB-a\fR flag.
.SH Files
-/usr/adm/faillog \- failure logging file
+/var/adm/faillog \- failure logging file
.SH See Also
login(1),
faillog(4)
--- faillog.h
+++ faillog.h 1994/04/17 17:59:13
@@ -19,7 +19,7 @@
* is indexed in that fashion.
*/
-#ifdef SVR4
+#if defined(SVR4) || defined(__linux__)
#define FAILFILE "/var/adm/faillog"
#else
#define FAILFILE "/usr/adm/faillog"
--- failure.c
+++ failure.c 1994/04/17 17:59:13
@@ -183,7 +183,11 @@
char lasttimeb[32];
char *lasttime = lasttimeb;
#else
+#if __STDC__
+ char lasttime[256];
+#else
char *lasttime;
+#endif
#endif
if (fail->fail_cnt == 0)
--- getdef.c
+++ getdef.c 1994/04/17 17:59:13
@@ -62,6 +62,7 @@
{ "ISSUE_FILE_ENAB", NULL },
{ "KILLCHAR", NULL },
{ "LASTLOG_ENAB", NULL },
+ { "LOGIN_STRING", NULL },
{ "LOG_UNKFAIL_ENAB", NULL },
{ "MAIL_CHECK_ENAB", NULL },
{ "MAIL_DIR", NULL },
--- gpmain.c
+++ gpmain.c 1994/04/17 17:59:13
@@ -329,7 +329,9 @@
struct sgrp *getsgnam ();
#endif
struct passwd *pw = 0;
+#ifndef __linux__
struct passwd *getpwuid ();
+#endif
struct passwd *getpwnam ();
/*
--- groups.1
+++ groups.1 1994/04/17 17:59:13
@@ -24,7 +24,7 @@
If the value does not have a corresponding entry in
\fB/etc/group\fR, the value will be displayed as the numerical group value.
The optional \fIuser\fR parameter will display the groups for the named
-\fIuser\R.
+\fIuser\fR.
.SH Note
Systems which do not support concurrent group sets will have the information
from \fB/etc/group\fR reported.
--- groups.c
+++ groups.c 1994/04/17 17:59:13
@@ -11,6 +11,8 @@
static char sccsid[] = "@(#)groups.c 3.2 09:47:19 25 Nov 1991";
+#include "ngroups.h"
+#include "config.h"
#include "stdio.h"
#include "pwd.h"
#include "grp.h"
@@ -54,19 +56,13 @@
char **argv;
{
int ngroups;
-#if NGROUPS > 0
-#if NGROUPS > 100
- gid_t *groups;
-#else
- gid_t groups[NGROUPS];
-#endif
+#ifdef NGROUPS_MAX
+ GID_T *groups;
int i;
#else
char *logname;
- char *getlogin();
#endif
struct group *gr;
- struct group *getgrgid();
if (argc == 1) {
@@ -75,7 +71,7 @@
* for the current user.
*/
-#if NGROUPS > 0
+#ifdef NGROUPS_MAX
/*
* This system supports concurrent group sets, so
* I can ask the system to tell me which groups are
@@ -83,9 +79,7 @@
*/
ngroups = getgroups (0, 0);
-#if NGROUPS > 100
- groups = (gid_t *) malloc (ngroups * sizeof (int *));
-#endif
+ groups = (GID_T *) malloc (ngroups * sizeof (GID_T));
getgroups (ngroups, groups);
/*
--- gshadow.c
+++ gshadow.c 1994/04/17 17:59:13
@@ -135,8 +135,8 @@
long atol ();
int i;
- strncpy (sgrbuf, string, (int) sizeof sgrbuf - 1);
- sgrbuf[sizeof sgrbuf - 1] = '\0';
+ strncpy (sgrbuf, string, (int) sizeof (sgrbuf) - 1);
+ sgrbuf[sizeof (sgrbuf) - 1] = '\0';
if (cp = strrchr (sgrbuf, '\n'))
*cp = '\0';
@@ -157,7 +157,7 @@
* the line is invalid.
*/
- if (cp || i != FIELDS)
+ if ((cp && *cp) || i != FIELDS)
return 0;
sgroup.sg_name = fields[0];
--- id.c
+++ id.c 1994/04/17 17:59:14
@@ -20,6 +20,7 @@
* the concurrent group set if the current system supports it.
*/
+#include "ngroups.h"
#include <sys/types.h>
#include <stdio.h>
#include <grp.h>
@@ -32,11 +33,7 @@
usage ()
{
-#if NGROUPS > 0
fprintf (stderr, "usage: id [ -a ]\n");
-#else
- fprintf (stderr, "usage: id\n");
-#endif
exit (1);
}
@@ -46,21 +43,13 @@
char **argv;
{
int id;
-#if NGROUPS > 0
-#if NGROUPS > 100
GID_T *groups;
-#else
- GID_T groups[NGROUPS];
-#endif
int ngroups;
int aflg = 0;
-#endif
- struct passwd *pw,
- *getpwuid();
- struct group *gr,
- *getgrgid();
-#if NGROUPS > 0
+ struct passwd *pw;
+ struct group *gr;
+
/*
* See if the -a flag has been given to print out the
* concurrent group set.
@@ -72,10 +61,6 @@
else
aflg = 1;
}
-#else
- if (argc > 1)
- usage ();
-#endif
/*
* Print out the real user ID and group ID. If the user or
@@ -109,7 +94,6 @@
else
printf (" egid=%d", id);
}
-#if NGROUPS > 0
/*
* Print out the concurrent group set if the user has requested
@@ -117,21 +101,20 @@
* names.
*/
- if (aflg && (ngroups = getgroups (0, 0)) != -1) {
+ if (aflg && NGROUPS_MAX > 1 && (ngroups = getgroups (0, 0)) > 0) {
int i;
-#if NGROUPS > 100
/*
* The size of the group set is determined so an array
* large enough to hold it can be allocated.
*/
- if (groups = (int *) malloc (ngroups * sizeof *groups)) {
+ if (!(groups = (GID_T *) malloc (ngroups * sizeof *groups))) {
putchar ('\n');
perror ("out of memory");
exit (1);
}
-#endif
+
/*
* Start off the group message. It will be of the format
*
@@ -153,7 +136,6 @@
printf ("%d", (int) groups[i]);
}
}
-#endif
/*
* Finish off the line.
--- lastlog.c
+++ lastlog.c 1994/04/17 17:59:14
@@ -26,8 +26,6 @@
#define strrchr rindex
#endif
-#define LASTFILE "/usr/adm/lastlog"
-
#include "config.h"
#include "lastlog.h"
--- lastlog.h
+++ lastlog.h 1994/04/17 17:59:14
@@ -1,3 +1,6 @@
+#ifndef _LASTLOG_H
+#define _LASTLOG_H
+
/*
* Copyright 1989, 1990, 1992, 1993, John F. Haugh II
* All rights reserved.
@@ -25,7 +28,7 @@
struct lastlog {
time_t ll_time;
char ll_line[8];
-#ifdef SVR4
char ll_host[16];
-#endif
};
+
+#endif
--- lmain.c
+++ lmain.c 1994/04/17 17:59:14
@@ -511,6 +511,13 @@
#ifdef RLOGIN
if (term[5] != '\0') /* see if anything after "TERM=" */
addenv (term);
+ /* if no flag(s) and TERM= is set then normal login */
+ else if (!pflg && !rflg && !fflg && !hflg
+ && (tmp = getenv("TERM")) != NULL) {
+ /* preserve TERM= from getty */
+ strcat(strcpy(term,"TERM="),tmp);
+ addenv(term);
+ }
#endif
/*
* Add the timezone environmental variable so that time functions
@@ -868,10 +875,8 @@
if (getdef_bool ("LASTLOG_ENAB") && lastlog.ll_time != 0) {
printf ("Last login: %.19s on %s",
ctime (&lastlog.ll_time), lastlog.ll_line);
-#ifdef SVR4
if (lastlog.ll_host[0])
printf(" from %.16s", lastlog.ll_host);
-#endif
printf("\n");
}
#ifdef AGING
--- log.c
+++ log.c 1994/04/17 17:59:14
@@ -36,14 +36,6 @@
#include "lastlog.h"
-#ifndef LASTLOG_FILE
-#ifdef SVR4
-#define LASTLOG_FILE "/var/adm/lastlog"
-#else
-#define LASTLOG_FILE "/usr/adm/lastlog"
-#endif /* SVR4 */
-#endif /* LASTLOG_FILE */
-
extern struct utmp utent;
#ifdef SVR4
extern struct utmpx utxent;
@@ -73,7 +65,7 @@
* If the file does not exist, don't create it.
*/
- if ((fd = open (LASTLOG_FILE, O_RDWR)) == -1)
+ if ((fd = open (LASTFILE, O_RDWR)) == -1)
return;
/*
@@ -104,9 +96,7 @@
(void) time (&newlog.ll_time);
(void) strncpy (newlog.ll_line, utent.ut_line, sizeof newlog.ll_line);
-#ifdef SVR4
- (void) strncpy (newlog.ll_host, utxent.ut_host, sizeof newlog.ll_host);
-#endif
+ (void) strncpy (newlog.ll_host, utent.ut_host, sizeof newlog.ll_host);
(void) lseek (fd, offset, 0);
(void) write (fd, (char *) &newlog, sizeof newlog);
(void) close (fd);
--- login.1
+++ login.1 1994/04/17 17:59:14
@@ -79,7 +79,7 @@
.SH Files
/etc/utmp \- list of current login sessions
.br
-/etc/wtmp \- list of previous login sessions
+/var/adm/wtmp \- list of previous login sessions
.br
/etc/passwd \- user account information
.br
--- login.defs
+++ login.defs 1994/04/17 17:59:14
@@ -1,8 +1,6 @@
#
# /etc/login.defs - Configuration control definitions for the login package.
#
-# @(#)login.defs 3.7 09:32:02 30 Apr 1993
-#
# Three items must be defined: MAIL_DIR, ENV_SUPATH, and ENV_PATH.
# If unspecified, some arbitrary (and possibly incorrect) value will
# be assumed. All other items are optional - if not specified then
@@ -12,27 +10,33 @@
#
#
+# login string (%u is replaced with username)
+#
+LOGIN_STRING "Password: " # traditional
+#LOGIN_STRING "%u's Password: " # shadow password suite style
+
+#
# Delay in seconds before being allowed another attempt after a login failure
#
-FAIL_DELAY 5
+FAIL_DELAY 1
#
# Enable additional passwords upon dialup lines specified in /etc/dialups.
#
-DIALUPS_CHECK_ENAB yes
+DIALUPS_CHECK_ENAB no
#
-# Enable logging and display of /usr/adm/faillog login failure info.
+# Enable logging and display of /var/adm/faillog login failure info.
#
FAILLOG_ENAB yes
#
# Enable display of unknown usernames when login failures are recorded.
#
-LOG_UNKFAIL_ENAB yes
+LOG_UNKFAIL_ENAB no
#
-# Enable logging and display of /usr/adm/lastlog login time info.
+# Enable logging and display of /var/adm/lastlog login time info.
#
LASTLOG_ENAB yes
@@ -44,12 +48,12 @@
#
# Enable additional checks upon password changes.
#
-OBSCURE_CHECKS_ENAB yes
+OBSCURE_CHECKS_ENAB no
#
# Enable checking of time restrictions specified in /etc/porttime.
#
-PORTTIME_CHECKS_ENAB yes
+PORTTIME_CHECKS_ENAB no
#
# Enable setting of ulimit, umask, and niceness from passwd gecos field.
@@ -60,32 +64,30 @@
# Enable "syslog" logging of su activity - in addition to sulog file logging.
# SYSLOG_SG_ENAB does the same for newgrp and sg.
#
-SYSLOG_SU_ENAB no
-SYSLOG_SG_ENAB no
+SYSLOG_SU_ENAB yes
+SYSLOG_SG_ENAB yes
#
# If defined, either full pathname of a file containing device names or
# a ":" delimited list of device names. Root logins will be allowed only
# upon these devices.
#
-CONSOLE /etc/consoles
-#CONSOLE console:tty01:tty02:tty03:tty04
+CONSOLE tty1:tty2:tty3:tty4:tty5:tty6:tty7:tty8
#
# If defined, all su activity is logged to this file.
#
-SULOG_FILE /usr/adm/sulog
+SULOG_FILE /var/adm/sulog
#
# If defined, ":" delimited list of "message of the day" files to
# be displayed upon login.
#
MOTD_FILE /etc/motd
-#MOTD_FILE /etc/motd:/usr/lib/news/news-motd
#
# If set to "yes" /etc/issue will be output before each login prompt
-ISSUE_FILE_ENAB yes
+ISSUE_FILE_ENAB no
#
# If defined, file which maps tty line to TERM environment parameter.
@@ -96,14 +98,14 @@
#
# If defined, login failures will be logged here in a utmp format.
#
-FTMP_FILE /etc/ftmp
+#FTMP_FILE /var/adm/ftmp
#
# If defined, name of file whose presence which will inhibit non-root
# logins. The contents of this file should be a message indicating
# why logins are inhibited.
#
-NOLOGINS_FILE /etc/nologins
+NOLOGINS_FILE /etc/nologin
#
# If defined, the command name to display when running "su -". For
@@ -118,7 +120,7 @@
# Directory where mailboxes reside, _or_ name of file, relative to the
# home directory. If you _do_ define both, MAIL_DIR takes precedence.
#
-MAIL_DIR /usr/spool/mail
+MAIL_DIR /var/spool/mail
#MAIL_FILE .mail
#
@@ -133,6 +135,7 @@
#
# If defined, the presence of this value in an /etc/passwd "shell" field will
# disable logins for that user, although "su" will still be allowed.
+# This option is not implemented right now...
#
NOLOGIN_STR NOLOGIN
@@ -140,19 +143,19 @@
# If defined, either a TZ environment parameter spec or the
# fully-rooted pathname of a file containing such a spec.
#
-ENV_TZ TZ=CST6CDT
-#ENV_TZ /etc/tzname
+#ENV_TZ TZ=CST6CDT
+ENV_TZ /usr/lib/zoneinfo/localtime
#
# If defined, an HZ environment parameter spec.
#
-ENV_HZ HZ=50
+ENV_HZ HZ=100
#
# *REQUIRED* The default PATH settings, for superuser and normal users.
#
-ENV_SUPATH PATH=/etc/local:/etc:/local/bin:/usr/bin:/bin
-ENV_PATH PATH=/local/bin:/usr/bin:/bin
+ENV_SUPATH PATH=/sbin:/usr/sbin:/usr/bin:/bin:/usr/X386/bin:/usr/TeX/bin
+ENV_PATH PATH=/usr/local/bin:/usr/bin:/bin:/usr/X386/bin:/usr/TeX/bin
#
# Terminal permissions
@@ -182,7 +185,7 @@
#
# Prefix these values with "0" to get octal, "0x" to get hexadecimal.
#
-ERASECHAR 010
+ERASECHAR 127
KILLCHAR 025
UMASK 022
ULIMIT 2097152
@@ -198,5 +201,5 @@
PASS_MAX_DAYS 99999
PASS_MIN_DAYS 0
PASS_MIN_LEN 5
-PASS_WARN_AGE 7
+PASS_WARN_AGE 14
--- newgrp.c
+++ newgrp.c 1994/04/17 17:59:14
@@ -12,6 +12,7 @@
* no warrantee of any kind.
*/
+#include "ngroups.h"
#include <sys/types.h>
#ifndef BSD
#include <string.h>
@@ -35,9 +36,9 @@
static char sccsid[] = "@(#)newgrp.c 3.11 07:34:23 08 Apr 1993";
#endif
-#ifdef NGROUPS
+#ifdef NGROUPS_MAX
int ngroups;
-gid_t groups[NGROUPS];
+gid_t groups[NGROUPS_MAX];
#endif
char *getpass();
@@ -60,7 +61,9 @@
#ifdef USE_SYSLOG
#include <syslog.h>
+#ifndef __linux__
/*VARARGS*/ int syslog();
+#endif
#ifndef LOG_WARN
#define LOG_WARN LOG_WARNING
@@ -248,7 +251,6 @@
}
}
}
-#ifdef NGROUPS
/*
* get the current users groupset. the new group will be
@@ -257,10 +259,11 @@
* group id's are set.
*/
- ngroups = getgroups (0, 0);
- if (ngroups > 0)
+ if (NGROUPS_MAX > 1) {
+ ngroups = getgroups (0, 0);
+ if (ngroups > 0)
getgroups (ngroups, groups);
-#endif
+ }
/*
* now we put her in the new group. the password file entry for
@@ -425,7 +428,7 @@
syslog (LOG_INFO, "user `%s' switched to group `%s'\n", name, group);
#endif
gid = grp->gr_gid;
-#ifdef NGROUPS
+#ifdef NGROUPS_MAX
/*
* i am going to try to add her new group id to her concurrent
@@ -439,7 +442,7 @@
break;
}
if (i == ngroups) {
- if (ngroups == NGROUPS) {
+ if (ngroups == NGROUPS_MAX) {
fprintf (stderr, "too many groups\n");
} else {
groups[ngroups++] = gid;
--- newusers.8
+++ newusers.8 1994/04/17 17:59:14
@@ -33,15 +33,13 @@
group is given, a new group will be created having this number.
.IP "pw_dir"
This field will be checked for existence as a directory and a new
-directory will the same name created if it does not already exist.
+directory with the same name will be created if it does not already exist.
The ownership of the directory will be set to be that of the user
being created or updated.
.PP
This command is intended to be used in a large system environment where
many accounts are updated at a single time.
.SH CAVEATS
-The \fImkpasswd\fR command must be executed afterwards to update the
-DBM password files.
The input file must be protected since it contains unencrypted passwords.
.SH SEE ALSO
-mkpasswd(8), passwd(1), useradd(1)
+passwd(1), useradd(1)
--- ngroups.h
+++ ngroups.h 1994/04/17 17:59:14
@@ -0,0 +1,15 @@
+#include <unistd.h>
+
+#ifdef _POSIX_VERSION
+#include <limits.h>
+#if !defined(NGROUPS_MAX) || NGROUPS_MAX < 1
+#undef NGROUPS_MAX
+#define NGROUPS_MAX sysconf (_SC_NGROUPS_MAX)
+#endif /* !NGROUPS_MAX */
+
+#else /* not _POSIX_VERSION */
+#include <sys/param.h>
+#if !defined(NGROUPS_MAX) && defined(NGROUPS)
+#define NGROUPS_MAX NGROUPS
+#endif /* not NGROUPS_MAX and NGROUPS */
+#endif /* not _POSIX_VERSION */
--- obscure.c
+++ obscure.c 1994/04/17 17:59:14
@@ -80,8 +80,10 @@
char *FascistCheck();
#endif
+#if 0
if (old[0] == '\0')
return (1);
+#endif
if ( strlen(new) < getdef_num("PASS_MIN_LEN", 0) ) {
printf ("Too short. ");
@@ -114,7 +116,7 @@
if (similiar (newmono, oldmono)) /* jumbled version */
return (0);
- if (simple (old, new)) /* keyspace size */
+ if (simple (new, old)) /* keyspace size */
return (0);
strcpy (wrapped, oldmono);
@@ -143,7 +145,7 @@
*/
/*ARGSUSED*/
-int palindrome (old, new)
+int palindrome (new, old)
char *old;
char *new;
{
@@ -164,7 +166,7 @@
*/
/*ARGSUSED*/
-int similiar (old, new)
+int similiar (new, old)
char *old;
char *new;
{
@@ -187,7 +189,7 @@
*/
/*ARGSUSED*/
-int simple (old, new)
+int simple (new, old)
char *old;
char *new;
{
--- passwd.1
+++ passwd.1 1994/04/17 17:59:14
@@ -70,15 +70,15 @@
Both entries are require to match in order for the password
to be changed.
.SS Group passwords
-When the \fB-g\f option is used, the password for the named
+When the \fB-g\fR option is used, the password for the named
group is changed.
The user must either be the super user, or a group administrator
for the named group.
The current group password is not prompted for.
-The \fB-r\f option is used with the \fB-g\f option to remove
+The \fB-r\fR option is used with the \fB-g\fR option to remove
the current password from the named group.
This allows group access to all members.
-The \fB-R\f option is used with the \fB-g\f option to restrict
+The \fB-R\fR option is used with the \fB-g\fR option to restrict
the named group for all users.
.SS Password expiry information
The password aging information may be changed by the super
--- passwd.c
+++ passwd.c 1994/04/17 17:59:14
@@ -295,6 +295,10 @@
char *passwd;
char *result;
{
+ if (! string || ! *string) {
+ while (*passwd)
+ *result++ = *passwd++;
+ } else {
while (*string) {
if (string[0] == ';') {
*result++ = *string++;
@@ -309,6 +313,7 @@
string++;
}
}
+ }
*result = '\0';
}
@@ -361,6 +366,8 @@
strcpy (orig, clear);
bzero (cipher, strlen (cipher));
bzero (clear, strlen (clear));
+ } else {
+ orig[0] = '\0';
}
/*
@@ -371,7 +378,7 @@
*/
printf (NEWPASSMSG, getdef_num ("PASS_MIN_LEN", 5));
- for (i = 0;i < 3;i++) {
+ for (i = 0;i < 5;i++) {
if (! (cp = getpass (NEWPASS))) {
bzero (orig, sizeof orig);
return -1;
@@ -395,7 +402,7 @@
}
bzero (orig, sizeof orig);
- if (i == 3) {
+ if (i == 5) {
bzero (pass, sizeof pass);
return -1;
}
--- pwauth.c
+++ pwauth.c 1994/04/17 17:59:14
@@ -28,7 +28,7 @@
static char sccsid[] = "@(#)pwauth.c 3.6 08:57:46 10 Jun 1993";
#endif
-char *PROMPT = "%s's Password:";
+char *PROMPT = "Password: ";
/*
* _old_auth - perform getpass/crypt authentication
@@ -38,6 +38,11 @@
* compared.
*/
+char *getpass ();
+char *pw_encrypt ();
+char *pwloginstr();
+char *getdef_str();
+
int
_old_auth (cipher, user, reason, input)
char *cipher;
@@ -93,7 +98,11 @@
*/
if (reason != PW_FTP && reason != PW_REXEC) {
- sprintf (prompt, PROMPT, user);
+ if (getdef_str("LOGIN_STRING") == NULL)
+ sprintf (prompt,"%s", PROMPT);
+ else
+ sprintf (prompt, "%s", pwloginstr(prompt,sizeof prompt,
+ getdef_str("LOGIN_STRING"), user));
clear = getpass (prompt);
}
--- pwauth.h
+++ pwauth.h 1994/04/17 17:59:14
@@ -14,11 +14,7 @@
* @(#)pwauth.h 3.2 17:40:49 01 May 1993
*/
-#if __STDC__
-int pw_auth (char * program, char * user, int flag, char * input);
-#else
int pw_auth ();
-#endif
/*
* Local access
--- pwck.c
+++ pwck.c 1994/04/17 17:59:14
@@ -75,7 +75,7 @@
char *CANTUPDATE = "%s: cannot update file %s\n";
char *CHANGES = "%s: the files have been updated; run mkpasswd\n";
char *NOCHANGES = "%s: no changes\n";
-char *NOGROUP = "user %s: no group %d\n";
+char *_NOGROUP = "user %s: no group %d\n"; /* NOGROUP is a macro in linux */
char *NOHOME = "user %s: directory %s does not exist\n";
char *NOSHELL = "user %s: program %s does not exist\n";
char *BADENTRY = "invalid password file entry\n";
@@ -401,7 +401,7 @@
* No primary group, just give a warning
*/
- printf (NOGROUP, pwd->pw_name, pwd->pw_gid);
+ printf (_NOGROUP, pwd->pw_name, pwd->pw_gid);
errors++;
}
--- pwloginstr.c
+++ pwloginstr.c 1994/04/17 17:59:14
@@ -0,0 +1,218 @@
+/*
+ * pwloginstr.c v1.1
+ *
+ * loginstr() parsing
+ *
+ * Copyright (C), 1994 Riku Meskanen - mesrik@tukki.jyu.fi
+ */
+
+/*
+This file is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+This file is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+I you don't have a copy of the GNU General Public License
+write to the Free Software Foundation, 675 Mass Ave,
+Cambridge, MA 02139, USA.
+*/
+
+#include <stdio.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+
+static void
+warning(s)
+char *s;
+{
+ fprintf(stderr,"Warning: /etc/login.defs LOGIN_STRING %s.\n", s);
+}
+
+static char *LOGIN_DEFAULT = "Password :";
+static char *too_long = "too long";
+static char *bad_escape = "syntax error, bad escape";
+static char *null_string = "syntax error, parsed string null";
+static char *quote_missing = "syntax error, quote-mark missing";
+
+char
+*pwloginstr(trgt, tmax, fmt, user)
+char *trgt;
+size_t tmax;
+char *fmt;
+char *user;
+{
+ char *rp; /* parse read pointer */
+ char *tp; /* target pointer */
+ short ql; /* quote level */
+ size_t ts; /* target size */
+ size_t tmp; /* temp sizer */
+
+ tp = trgt;
+ *tp= '\0';
+ ql = 0;
+ ts = 0;
+
+ while (*fmt && ql != -1) {
+ switch (*fmt) {
+ case '"' : if (!ql) { /* quote */
+ ++ql; /* enter in quoted string */
+ ++fmt;
+ continue;
+ }
+ ql = -1; /* exit from quoted string */
+ break;
+
+ case '\\' : if (!ql) {
+ warning(quote_missing);
+ return LOGIN_DEFAULT;
+ }
+
+ if (ts +2 > tmax) { /* char + nul */
+ warning(too_long);
+ return LOGIN_DEFAULT;
+ }
+
+ rp = NULL;
+ switch (*(fmt +1)) {
+ case 'a' : *tp = '\a'; break; /* BEL */
+ case 'b' : *tp = '\b'; break; /* BS */
+ case 'f' : *tp = '\f'; break; /* FF */
+ case 'n' : *tp = '\n'; break; /* CR */
+ case 'r' : *tp = '\r'; break; /* LF */
+ case 't' : *tp = '\t'; break; /* HT */
+ case 'v' : *tp = '\v'; break; /* VT */
+ case '\\': *tp = '\\'; break; /* backspace */
+ case '?' : *tp = '\?'; break; /* question mark */
+ case '\'': *tp = '\''; break; /* single quote */
+ case '\"': *tp = '\"'; break; /* double quote */
+
+ /* check if it's valid hex, octal or decimal
+ * syntax: 0 prefixed octals ( base 8 )
+ * 0x " hexadesimals ( base 16 )
+ * [1-9] " decimal ( base 10 )
+ */
+ default : if (isdigit((int) *(fmt+1))) {
+ /* yeah i know -- this sure is BFMI code. We lose
+ * some significant bits here, i don't care ;-)
+ */
+ *tp = (char) strtol((const char *) (fmt+1), &rp, 0);
+
+ if (tp < rp) /* did we get any bytes? */
+ break; /* yes, we did, so leave the case */
+ }
+ warning(bad_escape);
+ return LOGIN_DEFAULT;
+ }
+
+ if (rp == NULL) /* did we visit strtol() ? */
+ fmt += 2; /* no, skip over C std escape */
+ else
+ fmt += rp - fmt; /* yes, skip over octal etc... */
+
+ ++tp; /* adjust target and it's size */
+ ++ts;
+ break;
+
+ case '%' : if (!ql) {
+ warning(quote_missing);
+ return LOGIN_DEFAULT;
+ }
+ switch (*(fmt +1)) {
+ /* %u to username */
+ case 'u': if (ts + (tmp = strlen(user)) > tmax) {
+ warning(too_long);
+ return LOGIN_DEFAULT;
+ }
+ strcat(tp,user);
+ tp += tmp; /* adjust target pointer */
+ ts += tmp; /* and size */
+ tmp = 0; /* safe, if used later elsewere */
+ ++fmt;
+ break;
+ /* anything else is % itself */
+ default: if (ts +2 > tmax) {
+ warning(too_long);
+ return LOGIN_DEFAULT;
+ }
+ *tp++ = '%';
+ ++ts;
+ break;
+ }
+ ++fmt;
+ break;
+
+ default : if (!ql) { /* if not in quoted string */
+ while (*fmt && *fmt != '"') /* get first quote */
+ ++fmt;
+ break;
+ }
+ *tp = *fmt;
+ ++fmt;
+ ++tp;
+ ++ts;
+ } /* switch */
+
+ *tp = '\0';
+
+ } /* while */
+
+ if (ql > 0 ) {
+ warning(quote_missing);
+ return LOGIN_DEFAULT;
+ }
+
+
+ if (ts == 0) { /* if target is empty */
+ warning(null_string);
+ return LOGIN_DEFAULT;
+ }
+
+ return trgt;
+}
+
+
+#ifdef __TEST__
+/*
+ * simple test
+ */
+
+char *
+getstring(msg, str, mlen)
+char *msg;
+char *str;
+int mlen;
+{
+ char *s;
+
+ printf("%s ", msg);
+ if ((s = fgets(str, mlen, stdin)) != NULL && *s != '\n') {
+ *(s + strlen(s) -1) = '\0'; /* remove newline */
+ return s;
+ }
+ else
+ return NULL;
+}
+
+int
+main()
+{
+ char ls[80];
+ char fmt[60];
+ char usr[32];
+
+ while (getstring("LOGIN_STRING: ", fmt, sizeof(fmt)) &&
+ getstring("USER: ", usr, sizeof(usr))) {
+ printf("PROMPT: %s\n", pwloginstr(ls, sizeof(ls), fmt, usr) );
+ }
+
+ return 0;
+}
+
+#endif
+/* eof pwloginstr.c */
--- setup.c
+++ setup.c 1994/04/17 17:59:15
@@ -12,6 +12,7 @@
* no warrantee of any kind.
*/
+#include "ngroups.h"
#include <sys/types.h>
#include <utmp.h>
@@ -151,7 +152,7 @@
/*
* See if the GECOS field contains values for NICE, UMASK or ULIMIT.
- * If this feature is enabled in /etc/login.defs, we makes those
+ * If this feature is enabled in /etc/login.defs, we make those
* values the defaults for this login session.
*/
@@ -198,14 +199,13 @@
#endif
exit (errno);
}
-#if NGROUPS > 1
/*
* For systems which support multiple concurrent groups, go get
* the group set from the /etc/group file.
*/
- if (initgroups (info->pw_name, info->pw_gid) == -1) {
+ if (NGROUPS_MAX > 1 && initgroups (info->pw_name, info->pw_gid) == -1) {
puts ("initgroups failure");
#ifdef USE_SYSLOG
syslog (LOG_WARN, "initgroups failed for user `%s'\n",
@@ -214,7 +214,6 @@
#endif
exit (errno);
}
-#endif /* NGROUPS > 1 */
/*
* Set the real UID to the UID value in the password file.
--- shadow.4
+++ shadow.4 1994/04/17 17:59:15
@@ -71,6 +71,4 @@
su(1),
sulogin(1M),
shadow(3),
-passwd(4),
-pwconv(8),
-pwunconv(8)
+passwd(4)
--- shadow.c
+++ shadow.c 1994/04/17 17:59:15
@@ -9,9 +9,9 @@
* distribution media.
*/
-#include "shadow.h"
#include "config.h"
#include <stdio.h>
+#include "shadow.h"
#ifdef STDLIB_H
#include <stdlib.h>
@@ -201,9 +201,6 @@
struct spwd
*getspnam (name)
-#if __STDC__
-const
-#endif
char *name;
{
struct spwd *sp;
--- smain.c
+++ smain.c 1994/04/17 17:59:15
@@ -48,7 +48,9 @@
#ifdef USE_SYSLOG
#include <syslog.h>
+#ifndef __linux__
/*VARARGS*/ int syslog();
+#endif
#ifndef LOG_WARN
#define LOG_WARN LOG_WARNING
@@ -115,9 +117,11 @@
extern char *tz ();
extern char *pw_encrypt();
extern int pw_auth();
+#ifndef __linux__
extern struct passwd *getpwuid ();
extern struct passwd *getpwnam ();
extern struct spwd *getspnam ();
+#endif
extern char *getdef_str();
extern int getdef_bool();
extern char **environ;
@@ -344,9 +348,9 @@
#ifdef USE_SYSLOG
if ( getdef_bool("SYSLOG_SU_ENAB") )
syslog (pwent.pw_uid ? LOG_INFO:LOG_CRIT,
- "- %s %s-%s\n", tty,
- oldname[0] ? oldname:"???",
- name[0] ? name:"???");
+ "'su %s' failed for %s on /dev/%s\n",
+ name[0] ? name:"???",
+ oldname[0] ? oldname:"???", tty);
closelog ();
#endif
exit (1);
@@ -401,8 +405,8 @@
endspent ();
#ifdef USE_SYSLOG
if ( getdef_bool("SYSLOG_SU_ENAB") )
- syslog (LOG_INFO, "+ %s %s-%s\n", tty,
- oldname[0] ? oldname:"???", name[0] ? name:"???");
+ syslog (LOG_INFO, "'su %s' succeeded for %s on /dev/%s\n",
+ name[0] ? name:"???", oldname[0] ? oldname:"???", tty);
#endif
if (fakelogin)
setup (&pwent); /* set UID, GID, HOME, etc ... */
--- sppwd.c
+++ sppwd.c 1994/04/17 17:59:15
@@ -0,0 +1,58 @@
+#undef SHADOW_PWD
+#include <stdio.h>
+#include <sys/types.h>
+#include <shadow.h>
+#include <pwd.h>
+#include <grp.h>
+#include <unistd.h>
+
+struct passwd *_spsubspwd(struct passwd *pw)
+{
+ struct spwd *spw;
+ if (pw)
+ { spw = getspnam(pw->pw_name);
+ if (spw)
+ pw->pw_passwd = spw->sp_pwdp;
+ }
+ return(pw);
+}
+
+struct group *_spsubsgrp(struct group *gr)
+{
+ struct sgrp *sgr;
+ if (gr)
+ { sgr = getsgnam(gr->gr_name);
+ if (sgr)
+ gr->gr_passwd = sgr->sg_passwd;
+ }
+ return(gr);
+}
+
+struct passwd *_spgetpwuid(uid_t uid) { return(_spsubspwd(getpwuid(uid))); }
+
+struct passwd *_spgetpwnam(char *name) { return(_spsubspwd(getpwnam(name))); }
+
+struct passwd *_spgetpwent(void) { return(_spsubspwd(getpwent())); }
+
+struct passwd *_spfgetpwent(FILE *F) { return(_spsubspwd(fgetpwent(F))); }
+
+struct group *_spgetgrgid(gid_t gid) { return(_spsubsgrp(getgrgid(gid))); }
+
+struct group *_spgetgrnam(char *name) { return(_spsubsgrp(getgrnam(name))); }
+
+struct group *_spgetgrent(void) { return(_spsubsgrp(getgrent())); }
+
+struct group *_spfgetgrent(FILE *F) { return(_spsubsgrp(fgetgrent(F))); }
+
+char *_spcrypt(char clear[], char salt[] )
+{
+ static char buffer[30];
+ char *cp = crypt (clear, salt);
+ strcpy (buffer, cp);
+ if (strlen (clear) > 8) {
+ cp = crypt (clear + 8, salt);
+ strcat (buffer, cp + 2);
+ }
+ return(buffer);
+}
+
--- sulog.c
+++ sulog.c 1994/04/17 17:59:15
@@ -60,9 +60,10 @@
(void) time (&clock);
tm = localtime (&clock);
- (void) fprintf (fp, "SU %.02d/%0.2d %.02d:%.02d %c %.6s %s-%s\n",
+ (void) fprintf (fp, "SU %.02d/%0.2d %.02d:%.02d 'su %s'"
+ " %s for %s on /dev/%.6s\n",
tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min,
- success ? '+':'-', tty, oldname, name);
+ name, (success == 0)? "failed" : "succeeded", oldname, tty);
fflush (fp);
fclose (fp);
--- sulogin.c
+++ sulogin.c 1994/04/17 17:59:15
@@ -102,6 +102,7 @@
#define RETRIES 3
#endif
+SIGTYPE
catch (sig)
int sig;
{
@@ -225,14 +226,14 @@
closelog ();
#endif
#ifdef TELINIT
- execl ("/etc/telinit", "telinit", RUNLEVEL, (char *) 0);
+ execl (TELINIT, "telinit", RUNLEVEL, (char *) 0);
#endif
exit (0);
} else
strcpy (pass, cp);
if (pwent.pw_name && pwent.pw_passwd[0] == '@') {
- if (pw_auth (pwent.pw_passwd + 1, name, PW_LOGIN)) {
+ if (pw_auth (pwent.pw_passwd + 1, name, PW_LOGIN, "")) {
#ifdef USE_SYSLOG
syslog (LOG_WARN,
"Incorrect root authentication");
--- tz.c
+++ tz.c 1994/04/17 17:59:15
@@ -27,7 +27,7 @@
char *fname;
{
FILE *fp;
- static char tzbuf[64];
+ static char tzbuf[1024];
if ((fp = fopen(fname,"r")) == NULL)
return "TZ=CST6CDT";
--- useradd.c
+++ useradd.c 1994/04/17 17:59:15
@@ -16,6 +16,7 @@
static char sccsid[] = "@(#)useradd.c 3.14 08:20:53 23 Aug 1993";
#endif
+#include "ngroups.h"
#include "config.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -59,10 +60,6 @@
char def_file[] = "/usr/sadm/defadduser";
#else
char def_file[] = "/etc/default/useradd";
-#endif
-
-#ifndef NGROUPS_MAX
-#define NGROUPS_MAX 64
#endif
#if !defined(MDY_DATE) && !defined(DMY_DATE) && !defined(YMD_DATE)
--- userdel.c
+++ userdel.c 1994/04/17 17:59:15
@@ -47,10 +47,6 @@
#endif
#endif
-#ifndef NGROUPS_MAX
-#define NGROUPS_MAX 64
-#endif
-
#if defined(DIR_XENIX) || defined(DIR_BSD) || defined(DIR_SYSV)
#define DIR_ANY
#endif
@@ -377,7 +373,7 @@
struct spwd *spwd;
if ((spwd = spw_locate (user_name)) && spwd->sp_pwdp[0] == '@') {
- if (pw_auth (spwd->sp_pwdp + 1, user_name, PW_DELETE)) {
+ if (pw_auth (spwd->sp_pwdp + 1, user_name, PW_DELETE, "")) {
#ifdef USE_SYSLOG
syslog (LOG_ERR,
"failed deleting auth `%s' for user `%s'\n",
@@ -397,7 +393,7 @@
}
#endif /* SHADOWPWD */
if ((pwd = pw_locate (user_name)) && pwd->pw_passwd[0] == '@') {
- if (pw_auth (pwd->pw_passwd + 1, user_name, PW_DELETE)) {
+ if (pw_auth (pwd->pw_passwd + 1, user_name, PW_DELETE, "")) {
#ifdef USE_SYSLOG
syslog (LOG_ERR,
"failed deleting auth `%s' for user `%s'\n",
@@ -520,22 +516,22 @@
{
char buf[BUFSIZ];
-#ifdef HAS_CRONTAB
+#ifdef CRONTAB_REM
/*
* Remove the crontab if there is one.
*/
- sprintf (buf, "/bin/crontab -r -u %s", user);
+ sprintf (buf, CRONTAB_REM, user);
system (buf);
#endif
-#ifdef HAS_ATRM
+#ifdef ATRUN_REM
/*
* Remove any at jobs as well.
*/
- sprintf (buf, "/bin/atrm -f %s", user);
+ sprintf (buf, ATRUN_REM, user);
system (buf);
#endif
}
--- usermod.c
+++ usermod.c 1994/04/17 17:59:15
@@ -16,6 +16,7 @@
static char sccsid[] = "@(#)usermod.c 3.16 08:11:52 07 May 1993";
#endif
+#include "ngroups.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
@@ -48,10 +49,6 @@
#endif
#endif
-#ifndef NGROUPS_MAX
-#define NGROUPS_MAX 64
-#endif
-
#if defined(DIR_XENIX) || defined(DIR_BSD) || defined(DIR_SYSV)
#define DIR_ANY
#endif
@@ -1619,7 +1616,7 @@
* anything to just leave it be.
*/
- if ((fd = open ("/usr/adm/lastlog", O_RDWR)) != -1) {
+ if ((fd = open (LASTFILE, O_RDWR)) != -1) {
lseek (fd, (long) user_id * sizeof ll, 0);
if (read (fd, &ll, sizeof ll) == sizeof ll) {
lseek (fd, (long) user_newid * sizeof ll, 0);